<%@page contentType="text/html; charset=utf-8"%>

<div class="form-container">
	<form id="form">
		<table class="tableform">
			<tr>
				<th class="td100">请输入新密码：</th>
				<td><input name="password" class="easyui-validatebox" type="text" data-options="required: true, validType: 'engNum'"/></td>
			</tr>
			<tr style="display:none">
				<td>
					<input type="hidden" name="ids" value="${ids}">
				</td>
			</tr>
		</table>
	</form>
</div>

<script>
	var form_url = "${ctx}/admin/sys/user/adminChangePassword" ;
	
	//提交表单数据
	var submitNow = function($d, $dg, flag) {
		$.post(form_url, $("#form").form("getData"), function(result) {
			if (result.status) {
				$dg.datagrid('reload');alertify.success(result.message);$.easyui.loaded();
				if(flag==undefined||flag==false){$d.dialog("close") ;}
			} else {
				$.easyui.loaded();$.messager.alert("错误", result.message, "error");
			}
		}, 'json').error(function() { $.easyui.loaded(); });
	};
	
	//验证表单
	var submitForm = function($d, $dg, flag) { 
		if($('#form').form('validate')) {
			$.easyui.loading({ msg: "数据提交中，请稍等..." });
			submitNow($d, $dg, flag) ;
		}
	};
</script>

